package tech.aistar.day01.homework;

public class Computer {
    private String brand;
    private double price;
    private  String description;

    private Screen screen;

    public Computer() {
    }

    public Computer(String brand, double price, String description, Screen screen) {
        this.brand = brand;
        this.description = description;
        this.screen = screen;
        if(price>=1000&&price<=20000)
        {
            this.price = price;
        }
        else{
            this.price=2000;
        }
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        if(price>=1000 && price<=20000)
        {
            this.price = price;
        }
        else{
            this.price=2000;
        }
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Screen getScreen() {
        return screen;
    }

    public void setScreen(Screen screen) {
        this.screen = screen;
    }

    @Override
    public String toString() {
        return "本计算机的" +
                "品牌是" + brand  +
                ",价格是" + price +
                ",产品信息是" + description +'\n'
                +"屏幕信息是"+screen.getScreenbrand()+"的"+screen.getSize()+"寸大小的"
                +screen.getType()+"显示屏"
                ;
    }
}
